<%@ page contentType="text/html;charset=utf-8"%>
<%@ page language="java" import="weibo4j.http.*"%>
<%@ page language="java" import="weibo4j.*"%>
<%@ page language="java" import="java.util.List"%>
<%@ page language="java" import="weibo4j.Weibo"%>
<%@ page language="java" import="weibo4j.Status"%>
<%@ page language="java" import="weibo4j.WeiboException"%>
<%@ page language="java" import="weibo4j.User"%>
<%@ page language="java" import="java.io.UnsupportedEncodingException"%>
<jsp:useBean id="weboauth" scope="session"
	class="weibo4j.examples.WebOAuth" />
<%
	String verifier = request.getParameter("oauth_verifier");

	if (verifier != null) {
		System.out.println("oauth:" + verifier);
		RequestToken resToken = (RequestToken) session
				.getAttribute("resToken");

		if (resToken != null) {
			AccessToken accessToken = weboauth.requstAccessToken(
					resToken, verifier);
			if (accessToken != null) {
				Weibo weibo = new Weibo();
				Paging paging = new Paging();
				paging.setCount(20);
				paging.setPage(1);
				String userid = "1594186713";
				List<Tag> gettags = weibo.getTags("1594186713", paging);
				for (Tag status : gettags) {
					System.out.println(status.toString());
				}

			} else {
				out.println("access token request error");
			}

		} else {
			out.println("request token session error");
		}
	} else {
		out.println("verifier String error");
	}
%>
